package com.hspedu.writer;

import java.io.*;

/**
 * @author 谷其昊
 * @version 1.0
 * @date 2022/2/24
 * @time 20:28
 */
public class BufferedCopy_ {
    public static void main(String[] args) throws IOException {
        BufferedReader bufferedReader = new BufferedReader(new FileReader("D:\\BaiduNetdiskDownload\\韩顺平2021基础学Java\\temp\\note.txt"));
        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter("D:\\BaiduNetdiskDownload\\韩顺平2021基础学Java\\temp\\note2.txt"));
        String line;

        while ((line = bufferedReader.readLine()) != null){
            bufferedWriter.write(line);
            bufferedWriter.newLine();
        }

        if (bufferedReader != null){
            bufferedReader.close();
        }
        if (bufferedWriter != null){
            bufferedWriter.close();
        }
    }
}
